﻿<Controls:CallingUserControl x:Class="Coding4Fun.FakeCall.Controls.ReceivingCall"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:Controls="clr-namespace:Coding4Fun.FakeCall.Controls" 
	mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="White" 
	Width="480"
	Height="800"
	Background="Transparent"
	xmlns:Converters1="clr-namespace:Coding4Fun.FakeCall.Converters" 
	Unloaded="CallingUserControl_Unloaded">
	<Controls:CallingUserControl.Resources>
		<Converters1:ImageConverter x:Key="ImageConverter" />
	</Controls:CallingUserControl.Resources>
	<Grid Background="Transparent">
		<Rectangle Fill="{StaticResource PhoneContrastForegroundBrush}" Opacity=".6" />
			<Grid x:Name="LayoutRoot" Background="{StaticResource PhoneChromeBrush}">
				<Grid 
					Name="receivingPerson"
					ManipulationStarted="manipulationStarted"
					ManipulationCompleted="manipulationCompleted" 
					ManipulationDelta="manipulationDelta"
					VerticalAlignment="Bottom">
					<Grid.Resources>
					<Storyboard x:Name="CoastGrid">
						<DoubleAnimationUsingKeyFrames 
						Storyboard.TargetName="gridTranslate" 
						Storyboard.TargetProperty="Y">
							<EasingDoubleKeyFrame x:Name="coastY" 
									KeyTime="00:00:01" Value="0">

							</EasingDoubleKeyFrame>
						</DoubleAnimationUsingKeyFrames>
					</Storyboard>
				</Grid.Resources>
					<Grid.RenderTransform>
						<TranslateTransform x:Name="gridTranslate"/>
					</Grid.RenderTransform>
					<Grid.RowDefinitions>
						<RowDefinition Height="450"/>
						<RowDefinition />
					</Grid.RowDefinitions>
					<Image 
						Grid.Row="0"
						Name="img"
						Stretch="Uniform"
						Source="{Binding Settings.PersonPhoto, Converter={StaticResource ImageConverter}}" 
						VerticalAlignment="Bottom" />
					<StackPanel VerticalAlignment="Bottom" Grid.Row="0" Margin="15,0">
						<TextBlock Foreground="{StaticResource PhoneAccentBrush}" FontSize="25">INCOMING CALL</TextBlock>
						<TextBlock 
							FontSize="85"
							Text="{Binding Path=Settings.PersonName}"
							TextWrapping="Wrap"
							Margin="0,-10,0,0" />
						<StackPanel Orientation="Horizontal" Margin="0,0,0,20">
							<TextBlock FontSize="28" Text="{Binding Settings.PhoneType.Text}" />
							<TextBlock FontSize="28" Padding="0,0,5,0" Text=": " />
							<TextBlock FontSize="28" Text="{Binding Settings.PersonPhoneNumber}" />
						</StackPanel>
					</StackPanel>

					<Grid Grid.Row="1">
					
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="*" />
							<ColumnDefinition Width="*" />
						</Grid.ColumnDefinitions>
						<Button Content="answer" Click="Button_Click_1" />
						<Button Content="ignore" Grid.Column="1" Click="Button_Click" />

						<MediaElement Volume="1" AutoPlay="False" Name="player" Source="/Coding4Fun.FakeCall;component/Media/Alert 5.mp3" />
					</Grid>
					<Grid 
						Name="slideBar"
						Grid.Row="1" 
						Background="{StaticResource PhoneAccentBrush}">
						<TextBlock
							VerticalAlignment="Center"
							Padding="20,0"
							FontSize="{StaticResource PhoneFontSizeMediumLarge}">
								slide up
						</TextBlock>
					</Grid>
				</Grid>
				
			<Controls:PhoneInfo
					x:Name="phoneInfo"
					VerticalAlignment="Top" />
			
		</Grid>
	</Grid>
</Controls:CallingUserControl>